﻿@model MembershipUser
@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>
@{
    Html.BeginForm("Edit", "Users", FormMethod.Post);
    <fieldset>
        <legend>Editing @Model.UserName</legend>
        @Html.LabelFor(x=>x.UserName, "Username: ")
        @Model.UserName<br/>
        @Html.Label("New Password: ")
        @Html.Editor("password")<br/>
        @Html.LabelFor(x=>x.Email, "E-mail: ")
        @Html.EditorFor(x=>x.Email)
        <p>
            <b>User roles:</b><br/>
            <ul>
                @foreach(var role in Roles.GetRolesForUser(Model.UserName))
                {
                    <li>@role</li>
                }
            </ul>  
        </p>
        @Html.Hidden("oldusername", Model.UserName)
        
        <input type="submit" value="Save Changes"/>
        <input type="reset" value="Reset"/>
    
    </fieldset>
    Html.EndForm();
}